package com.healthcloud.utils;

import com.healthcloud.entity.Dict;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
 * 数据字典工具类常量
 * Created by xiam on 2015/6/8.
 */
public abstract class DictUtils {

	/**
	 * 医院等级字典
	 */
	public static final String HOSP_LVL = "hosp_lvl";

	/**
	 * 医院治疗病种范围字典
	 */
    public static final String HOSP_SCOPE = "hosp_scope";

	/**
	 * 性别字典
	 */
    public static final String GENDER = "gender";

	/**
	 * 职业类型字典
	 */
    public static final String DEGREE = "degree";

	/**
	 * 血液类型字典
	 */
    public static final String BLOOD_TYPE = "bloodType";

	/**
	 * RH血液类型字典
	 */
    public static final String RH_TYPE = "rhType";

	/**
	 * 婚姻状况字典
	 */
    public static final String MARITAL_STATE = "maritalState";

	/**
	 * 生育状况字典
	 */
    public static final String FERTILITY_STATE = "fertilityState";

	/**
	 * 户口类型字典
	 */
    public static final String HUKOU_TYPE = "hukouType";

	/**
	 * 名族字典
	 */
    public static final String NATIONALITY = "nationality";

	/**
	 * 职业类型字典
	 */
    public static final String CAREER = "career";

	/**
	 * 将字典集合封装成map用于查询
	 * @param dicts
	 * @return
	 */
	public static final Map<Integer, String> map(Collection<Dict> dicts) {
		Map<Integer, String> map = new HashMap<Integer, String>();
		for (Dict dict : dicts) {
			map.put(dict.getCode(), dict.getName());
		}
		return map;
	}
}
